<template>
	<view class="pageBox">
		<!-- 标题栏 -->
		<head-navbar :back="true">
			<view>设置</view>
		</head-navbar>
		<view class="content">
			<view class="list">
				<view class="item_add" @click="toPage(0,'/pages/my/myService/setting/address/address')">
					<view class="left">
						收货地址管理
					</view>
					<view class="right iconfont icon-fanhui"></view>
				</view>
			</view>
			<view class="list">
				<view class="item" @click="toPage(0,'/pages/my/myService/setting/fixPwd/fixPwd?type=0')">
					<view class="left">
						修改登录密码
					</view>
					<view class="right iconfont icon-fanhui"></view>
				</view>
			</view>
			<view class="list">
				<view class="item" @click="toPage(0,'/pages/my/myService/setting/fixPwd/fixPwd?type=1')">
					<view class="left">
						修改交易密码
					</view>
					<view class="right iconfont icon-fanhui"></view>
				</view>
			</view>
			<!-- <view class="list">
				<view class="item" @click="toPage(0,'/pages/my/myService/setting/afterSale/afterSale?state=0')">
					<view class="left">
						售后
					</view>
					<view class="right iconfont icon-fanhui"></view>
				</view>
			</view> -->
			<!-- <view class="list">
				<view class="item" @click="toPage(0,'/pages/my/myService/merchant/index')">
					<view class="left">
						成为商家
					</view>
					<view class="right_box">
						<view class="text" v-show="auth.authStatus==0">{{MerchantTitle}}</view>
						<view class="rightIcon iconfont icon-fanhui"></view>
					</view>
				</view>
			</view> -->
			<view class="list">
				<view class="item" style="border: 0;" @click="toPage(0,'/pages/getMoney/getMoney?uId='+uId+'&phone='+phone)">
					<view class="left">
						实名收款
					</view>
					<view class="right_box">
						<view class="text" v-show="auth.authStatus==0">未认证</view>
						<view class="text" v-show="auth.authStatus==1">认证中</view>
						<view class="text" v-show="auth.authStatus==2">已认证</view>
						<view class="text" v-show="auth.authStatus==3">认证失败</view>
						<view class="rightIcon iconfont icon-fanhui"></view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {getAuthInfo} from '../../../../api/user/index'
	import * as api from '@/api/user/pwd.js';
	export default {
		data() {
			return {
				uId:'',
				phone:'',
				auth:{},
				MerchantTitle:''
			}
		},
		onLoad(option) {
			this.uId = option.uId
		},
		onShow(){
			this.getAuthInfoFuc();
			this.getMerchantApplyStatus();
		},
		methods: {
			getAuthInfoFuc(){
				getAuthInfo().then(res=>{
					this.auth = res.data.obj.auth
					this.phone = res.data.obj.user.phone
				})
			},
			async getMerchantApplyStatus() {
				try {
					const ret = await api.merchantApplyStatus();
					console.log(ret)
					if(ret.data.obj == 0) {
						this.MerchantTitle = '审核中'
					}else if(ret.data.obj == 1){
						this.MerchantTitle = '已认证'
					}else{
						this.MerchantTitle = '审核不通过'
					}
				} catch (error) {
			
				}
			},
		}
	}
</script>

<style lang="scss">
@import './index.scss';
</style>
